#ifndef __RB_BUF_H
#define __RB_BUF_H

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>


#include "debug.h"


#define BUF_SIZE 4096
#define MAX_BUF_SIZE 4096

typedef struct buf
{
	uint8_t *data;
	int32_t size;
} buf;

//create buf object
int buf_init( buf** );
//add some more data to buf of bin/txt
int buf_add( buf*, buf );
//get some data in txt unitl newline
int buf_get_nl(  );
//get some data in bin of some size
int buf_get_data( buf*, int32_t, buf** );
//clean buf, return memory back
int buf_destroy( buf* );

#endif
